﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using EShop.DAL;

namespace EShop.BLL
{
    public class MerchandiseAlertBAL
    {
        DAL.MerchandiseAlertDAL oMerchandiseAlert = new MerchandiseAlertDAL();

        /// <summary>
        /// 查询濒临低量的商品
        /// </summary>
        /// <param name="Barcode"></param>
        /// <param name="iType"></param>
        /// <returns></returns>
        public DataTable MerchandiseStockLowAlert(string Barcode, int iType)
        {
            return oMerchandiseAlert.MerchandiseStockLowAlert(Barcode, iType);
        }

        /// <summary>
        /// 修改商品低量报警设置
        /// </summary>
        /// <param name="strBarcode"></param>
        /// <param name="byteIsAlert"></param>
        /// <param name="iAlertNum"></param>
        /// <returns></returns>
        public bool UpdateStockLowAlertStatus(string strBarcode, byte byteIsAlert, int iAlertNum)
        {
            int i = oMerchandiseAlert.UpdateStockLowAlertStatus(strBarcode, byteIsAlert, iAlertNum);
            return i > 0 ? true : false;
        }

        /// <summary>
        /// 商品逾期报警
        /// </summary>
        /// <param name="iAlertEarlierDay">提前报警时间</param>
        /// <returns></returns>
        public DataTable MerchandiseOverTimeAlert(int iAlertEarlierDay)
        {
            return oMerchandiseAlert.MerchandiseOverTimeAlert(iAlertEarlierDay);
        }
    }
}
